﻿using WpfMvvmTemplate.WPFUI.Common;
using ScottPlot.Styles;
using Wpf.Ui.Appearance;

namespace WpfMvvmTemplate.WPFUI.Views.Pages
{
    public partial class DashboardPage
    {
        public DashboardPage()
        {
            InitializeComponent();

            //加载中英文
            ComMethod.LanguageWinDicHelper(GlobalStaticData.LanguageNum, this);

            // 禁用曲线的左键点击事件，否则在非全屏模式下，点击曲线会导致曲线位置移动，紊乱
            wpfPlot.MouseLeftButtonDown += (s, e) => e.Handled = true;

        }

        private void wpfPlot_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            ApplicationTheme CurrentTheme = ApplicationThemeManager.GetAppTheme();
            wpfPlot?.Plot.Style(CurrentTheme == ApplicationTheme.Dark ? new Gray1() : new Default());
            wpfPlot?.Refresh();
        }

        private void Page_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {

        }
    }
}
